package com.xuetang9.t9.xinhuaxia.controller;

import com.xuetang9.t9.xinhuaxia.alipay.PayUtil;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.*;

import javax.servlet.http.HttpServletRequest;

/**
 * @author 李亚奇
 * @version 1.0
 * @desc TODO
 * @date 2020/3/10 13:22
 * @copyright liyq
 * @address 成都西部国际金融中心2栋2201
 **/
@Controller
@RequestMapping("alipay")
public class AlipayController {

    @RequestMapping("pay")
    @ResponseBody
    public String payBefore(String orderId,String orderInfo,String totalPay, String descOrder){
        System.out.println(55589);
        System.out.println(orderId);
        System.out.println(orderInfo);
        System.out.println(totalPay);
        System.out.println(descOrder);
        System.out.println(55589);

        String alipay = PayUtil.alipay(orderId, orderInfo, totalPay, descOrder);
        if (alipay!=null){
            return alipay;
        }
        return null;
    }

    @RequestMapping("pay1")
    @ResponseBody
    public String getInfo(HttpServletRequest request){
        String requestURI = request.getRequestURI();
        System.out.println(55589);
        return requestURI;
    }


}
